Slice-Hoisting for Array-Size Inference in MATLAB
نویسندگان
چکیده
Inferring variable types precisely is very important to be able to compile MATLAB libraries effectively in the context of the telescoping languages framework being developed at Rice. Past studies have demonstrated the value of type information in optimizing MATLAB [4]. The variable types are inferred through a static approach based on writing propositional constraints on program statements [11]. The static approach has certain limitations with respect to inferring array-sizes. Imprecise inference of array-sizes can have a drastic effect on the performance of the generated code, especially in those cases where arrays are resized dynamically. The impact of appropriate array allocation is also borne out of earlier studies [3]. This paper presents a new approach to inferring array-sizes, called slice-hoisting. The approach is based on simple code transformations and is easy to implement in a practical compiler. Experimental evaluation shows that slice-hoisting, along with the constraints-based static algorithm, can result in a very high level of precision in inferring MATLAB array sizes.
منابع مشابه
Calculation of the Scattered Radiation Profile in 64 Slice CT Scanners Using Experimental Measurement
Introduction: One of the most important parameters in x-ray CT imaging is the noise induced by detected scattered radiation. The detected scattered radiation is completely dependent on the scanner geometry as well as size, shape and material of the scanned object. The magnitude and spatial distribution of the scattered radiation in x-ray CT should be quantified for development of robust scatter...
متن کاملA sparse matrix approach to reverse mode automatic differentiation in Matlab
We review the extended Jacobian approach to automatic differentiation of a user-supplied function and highlight the Schur complement form’s forward and reverse variants. We detail a Matlab operator overloaded approach to construct the extended Jacobian that enables the function Jacobian to be computed using Matlab’s sparse matrix operations. Memory and runtime costs are reduced using a variant ...
متن کاملThe Type Inference Engine for MATLAB
Lines In[1] and Out[2] below demonstrate a simple interaction with through a notebook interface.1 On line In[1] , the type function object is applied on a representation of the MATLAB expression tanh(3.78i). ’s response, shown on Out[2] , is the inferred type of tanh(3.78i). In this case, “type” is the expression {v, i, s} where v, i and s are the value range, intrinsic type and array shape of ...
متن کاملAn Inference Mechanism for the Compilation of Interactive Array Languages
Interactive array languages are powerful programming tools for the development of programs for numerical computation. They provide an environment that tends to increase productivity in software development. The trade-off is that in order to provide this nicer programming environment, array languages are usually interpreted, with the resulting negative effect on performance. The ideal programmin...
متن کاملVRIR specifications
Array-based languages, such as MATLAB and Python’s NumPy library, usually share some common features. For example, both MATLAB and Python have matrix multiplication built-in to the language and offer support for array slicing operators. Details of the exact semantics of some array operators may vary slightly, but the basic ideas are substantially similar. Languages like MATLAB and especially Py...
متن کامل